//
//  NSString+Speakin.m
//  SpeakinDemo
//
//  Created by west on 2017/8/21.
//  Copyright © 2017年 speakin. All rights reserved.
//

#import "NSString+Speakin.h"

@implementation NSString (Speakin)

+ (BOOL)isEmpty:(NSString *)str {
    if (!str) {
        return true;
    } else {
        NSCharacterSet *set = [NSCharacterSet whitespaceAndNewlineCharacterSet];
        NSString *trimedString = [str stringByTrimmingCharactersInSet:set];
        if ([trimedString length] == 0) {
            return true;
        } else {
            return false;
        }
    }
}

- (BOOL)isEmpty {
    NSCharacterSet *set = [NSCharacterSet whitespaceAndNewlineCharacterSet];
    NSString *trimedString = [self stringByTrimmingCharactersInSet:set];
    if ([trimedString length] == 0) {
        return true;
    } else {
        return false;
    }
}

@end
